home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / gui / precog2_1.lha / Precognition2_1 / include / Precognition_utils.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-21  |  2.5 KB  |  95 lines

  1. #ifndef PRECOGNITION_UTILS_H
  2. #define PRECOGNITION_UTILS_H
  3.  
  4. #include <intuition/intuition.h>
  5. #include "intuition_typedefs.h"
  6. #include "parms.h"
  7.  
  8. #ifndef PRECOGNITION_UTILS_BODY
  9. extern TextAttr pcg_Topaz80;
  10. #endif
  11.  
  12.  
  13.  
  14. #define pcg_GadgetRelativeCoords( g,e) GadgetRelativeCoods(g,e)
  15. /* Translates the MouseX, MouseY coordinates of a gadget-related
  16.  * IntuiMessage into coordinates which are relative to the gadget
  17.  * (instead of the window.)
  18.  */
  19.  
  20.  
  21.  
  22. void ChainGadgets __PARMS(( Gadget *start_of_chain, Gadget *gadget ));
  23.  
  24.  
  25.  
  26. typedef struct AlignInfo   /* Used for alignment of text to objects */
  27. {
  28.    UBYTE Flags;
  29.    BYTE  Xpad;
  30.    BYTE  Ypad;
  31. } AlignInfo;
  32.  
  33. /* Text Alignment Flags */
  34. #define tx_LEFT      1
  35. #define tx_XCENTER   2
  36. #define tx_RIGHT     4
  37. #define tx_TOP       8
  38. #define tx_YCENTER   16
  39. #define tx_BOTTOM    32
  40. #define tx_INSIDE    64
  41. #define tx_OUTSIDE   128
  42.  
  43. #define STD_XPAD 4   /* Standard XPad value. */
  44. #define STD_YPAD 2   /* Standard YPad value. */
  45.  
  46.  
  47. /*
  48. ** This is a 'value added' version of 'struct IntuiText'
  49. **
  50. ** An 'AlignInfo' structure is appended to the end of the
  51. ** IntuiText data.  This information allows an object to
  52. ** intelligently reposition of the text when the object
  53. ** is resized.
  54. *
  55. *    Additions by EDB October 21, 1994
  56. ** A (LONG) TextLength member was added so we could cache the
  57. *  results of IntuiTextLength() for width information.
  58. */
  59.  
  60. typedef struct PrecogText
  61. {
  62. #if 0  /* same as struct IntuiText */
  63.    struct IntuiText  PText ;
  64. #endif
  65.    UBYTE             FrontPen,
  66.                      BackPen;   /* the pen numbers for the rendering */
  67.    UBYTE             DrawMode;  /* the mode for rendering the text */
  68.    SHORT             LeftEdge;  /* relative start location for the text */
  69.    SHORT             TopEdge;   /* relative start location for the text */
  70.    struct TextAttr  *ITextFont; /* if NULL, you accept the default */
  71.    UBYTE            *IText;     /* pointer to null-terminated text */
  72.    struct IntuiText *NextText;  /* continuation to TxWrite another text */
  73.  
  74.    AlignInfo         alignment;
  75.    LONG              TextLength;
  76. } PrecogText;
  77.  
  78.  
  79. void AlignText __PARMS((
  80.                 PrecogText        *ptext,
  81.             Point              size ));
  82.    /*
  83.    ** Aligns text 'ptext' relative to an object of
  84.    ** dimensions 'size'.
  85.    */
  86.  
  87. /* Added Function -- EDB */
  88. void pcgTextSize __PARMS(( PrecogText    *ptext));
  89.    /*
  90.    ** Sets the PrecogText TextLength field by using IntuiTextLength()
  91.    ** function on the text string with the given font attributes
  92.    */
  93.  
  94. #endif
  95.